home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 428_02 / libsrc / vputca.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-13  |  711 b   |  42 lines

  1. /*
  2. ** vputca.c
  3. **
  4. ** Pictor, Version 1.51, Copyright (c) 1992-94 SoftCircuits
  5. ** Redistributed by permission.
  6. */
  7.  
  8. #include "pictor.h"
  9.  
  10. /*
  11. ** Writes a character/attribute to the current video position.
  12. */
  13. void vputca(int value)
  14. {
  15.     _asm    mov    di,_PL_offset
  16.     _asm    mov    ax,_PL_segment
  17.     _asm    mov    es,ax
  18.     _asm    mov    ax,value
  19.     _asm    cmp    _PL_snowcheck,FALSE
  20.     _asm    je    direct
  21.     _asm    mov    bx,ax
  22.     _asm    mov    dx,CGA_STATUS_PORT
  23.     scan_lo:
  24.     _asm    in     al,dx
  25.     _asm    shr    al,1
  26.     _asm    jc     scan_lo
  27.     _asm    cli
  28.     scan_hi:
  29.     _asm    in     al,dx
  30.     _asm    shr    al,1
  31.     _asm    jnc    scan_hi
  32.     _asm    xchg    ax,bx
  33.     _asm    stosw
  34.     _asm    sti
  35.     _asm    jmp   end_vputca
  36.     direct:
  37.     _asm    stosw
  38.     end_vputca:
  39.     _asm    mov   _PL_offset,di
  40.  
  41. } /* vputca */
  42.